|
Propeller Activity Board A/D Voltage Library
v0.85
Take DC voltage measurements with A/D 0, 1, 2, and/or 3.
|
Initialize ADC124S021 and measure voltage as a raw, 12-bit5 adc value.
CONSTRUCTION ZONE: This library is preliminary, revisions pending.
More...
Functions | |
| int | adc124S021dc (int channel) |
| void | adc_init (int csPin, int sclPin, int doPin, int diPin) |
| Initialize A/D converter. | |
| int | adc_in (int channel) |
| Get value that corresponds to voltage measurement on one of the A/D converter's input channels. This number indicates voltage in terms of 4096ths of 5 v. | |
Initialize ADC124S021 and measure voltage as a raw, 12-bit5 adc value.
CONSTRUCTION ZONE: This library is preliminary, revisions pending.
| int adc_in | ( | int | channel | ) |
Get value that corresponds to voltage measurement on one of the A/D converter's input channels. This number indicates voltage in terms of 4096ths of 5 v.
| channel | The A/D converter's input channel, either channel 0, 1, 2, or 3. Marked A/D 0, 1, 2 or 3 on the Propeller Activity Board. |
| void adc_init | ( | int | csPin, |
| int | sclPin, | ||
| int | doPin, | ||
| int | diPin | ||
| ) |
Initialize A/D converter.
Call this function once before calling adc_in or adc_volts.
Propeller Activity Board Example:
| csPin,Propeller | I/O pin connected to the A/D converter's chip select pin. The Propeller chip uses that pin to enable communication with the A/D converter chip. This connection is labeled /CS-P21 on the Propeller Activity Board. In that case Propeller I/O pin P21 is connected to the A/D converter's chip select pin, so you would use 21 for this parameter. |
| sclPin,Propeller | I/O pin connected to the A/D converter's serial clock pin. The Propeller chip sends a series of pulses to the A/D converter's SCL pin to drive the conversion and signal to send/recieve binary conversion values. This connection is labeled SCL-P20 on the Propeller Activity Board. In that case Propeller I/O pin P20 is connected to the A/D converter's serial clock pin, so you would use 20 for this parameter. |
| doPin,Propeller | I/O pin connected to the A/D converter's data out pin. The A/D converter sends binary values to the controller with this pin. This connection is labeled DO-P19 on the Propeller Activity Board. In that case Propeller I/O pin P19 is connected to the A/D converter's data out pin, so you would use 19 for this parameter. |
| diPin,Propeller | I/O pin connected to the A/D converter's data in pin. The Propeller chip sends a channel selection to the A/D converter, and it receives it with this pin. This connection is labeled DI-P18 on the Propeller Activity Board. In that case Propeller I/O pin P18 is connected to the A/D converter's chip data in, so you would use 18 for this parameter. |
1.8.1.2